home *** CD-ROM | disk | FTP | other *** search
/ Just Call Me Internet / Just Call Me Internet.iso / prog / mint / duftp / extras / slip.dip < prev   
Encoding:
Text File  |  1995-07-12  |  2.3 KB  |  105 lines

  1. #
  2. # Annex terminal login script.
  3. #
  4. # Author:   Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
  5. # Modified:    Craig Graham, <craig.graham@newcastle.ac.uk>
  6. #
  7.  
  8. main:
  9.   print DIP Script for Newcastle University.
  10.   print (C)Craig Graham,30/1/95.
  11.  
  12. # First of all, set up our name for this connection.
  13. # I am called "falcon.newcastle.ac.uk"
  14.   get $local falcon.newcastle.ac.uk
  15.  
  16. # Next, set up the other side's name and address.
  17. # My dialin machine is called 'knott.newcastle.ac.uk' (== 128.240.2.11)
  18.   get $remote knott
  19.  
  20. # Set netmask on sl0 to 255.255.255.0
  21.   netmask 255.255.255.0
  22.  
  23. # Set the desired serial port and speed.
  24. #  I've got a real slow modem :(
  25.   port ttyb
  26.   speed 2400
  27.  
  28. # Reset the modem and terminal line.
  29. # This seems to cause trouble for some people!
  30.   reset
  31.  
  32. # Prepare for dialing.
  33.   send ATQ0V1E1X4\r
  34.   wait OK 2
  35.   if $errlvl != 0 goto modem_trouble
  36.   print Dialing...
  37.   dial 2226455
  38.   if $errlvl != 0 goto modem_trouble
  39.   wait CONNECT 30
  40.   if $errlvl != 0 goto no_connect
  41.   print ...connected.
  42.  
  43. # We are connected.  Login to the system.
  44. login:
  45.   sleep 2
  46.   wait knott: 20
  47.   print Requesting a CSLIP connection...
  48.   send slip\n
  49.   wait Username: 20
  50.   if $errlvl != 0 goto login_error
  51.   send n08z7\n
  52.   wait Password: 20
  53.   if $errlvl != 0 goto password_error
  54. #send a password here
  55.   send my_password\n
  56. loggedin:
  57.  
  58. # Set the remote IP address (this may have already been done,
  59. #  but just to be sure).
  60.   get $rmtip 128.240.2.11
  61.  
  62. # Get the allocated local IP address from the Annex.
  63.   wait Your 20
  64.   wait is 15
  65.   get $locip remote
  66.  
  67.   if $errlvl != 0 goto prompt_error
  68.  
  69. # Set up the SLIP operating parameters.
  70.   get $mtu 296
  71.  
  72. # Ensure "route add -net default knott.newcastle.ac.uk" will be done
  73.   default
  74.  
  75. # Say hello and switch to SLIP mode.
  76. done:
  77.   print CONNECTED $locip ---> $rmtip
  78.   mode CSLIP
  79.   goto exit
  80.  
  81. prompt_error:
  82.   print TIME-OUT waiting for SLIPlogin to fire up...
  83.   goto error
  84.  
  85. login_trouble:
  86.   print Trouble waiting for the Login: prompt...
  87.   goto error
  88.  
  89. password:error:
  90.   print Trouble waiting for the Password: prompt...
  91.   goto error
  92.  
  93. no_connect:
  94.   print Cann't connect to remote host...
  95.   goto error
  96.  
  97. modem_trouble:
  98.   print Trouble ocurred with the modem...
  99. error:
  100.   print CONNECT FAILED to $remote
  101.   quit
  102.  
  103. exit:
  104.   exit
  105.